package com.itheima.a48;

public class MyTest {

    public static void main(String[] args) {
        System.out.println(Animal.class.isAssignableFrom(Dog.class)); //true
        System.out.println(Animal.class.isAssignableFrom(Cat.class));// true
        System.out.println(Animal.class.isAssignableFrom(Vegetable.class));// false
    }

    static interface Animal{}

    static class Dog implements Animal{}
    static class Cat implements Animal{}
    static class Vegetable {}

}
